package edu.pxxy.zxl;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

public class MyDBOpenHelper extends SQLiteOpenHelper {
    public static final String DB_NAME="zxl.db";
    public static final int DB_VERSION=1;
    public MyDBOpenHelper(Context mcontext){
        super(mcontext,DB_NAME,null,DB_VERSION);
    }
    @Override
    public void onCreate(SQLiteDatabase sqLiteDatabase) {
        /*String sql="create table if not exists food"+
                "(_id integer primary key autoincrement,foodname text,foodprice real,count real)";
        sqLiteDatabase.execSQL(sql);*/
        sqLiteDatabase.execSQL("CREATE TABLE food(_id INTEGER PRIMARY KEY AUTOINCREMENT,foodname TEXT(20),foodprice REAL,count INTEGER)");


    }

    @Override
    public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {

    }
}
